#ifndef SERVER_CONN_H
#define SERVER_CONN_H

#include "base_conn.h"

struct server_options {
	int verbosity;
	asio::ip::udp::endpoint udp_listen_addr;
	asio::ip::tcp::endpoint tcp_forward_addr;
};

class ServerConn: public BaseConn
{
	private:
		server_options opt;

		void handleSendHeader(Token tk, const boost::system::error_code& e);
		void handleReadHeader(Token tk, const boost::system::error_code& e);
		void handleTcpConnect(Token tk, const boost::system::error_code& e);

	public:
		ServerConn(asio::io_service& ioservice_, UdpService& udpservice, server_options opt_);

		void handleUdpAccept();
};
typedef boost::shared_ptr<ServerConn> ServerConnRef;

#endif//SERVER_CONN_H
